import React, {Component} from 'react';
import echarts from 'echarts'
import '../css/LeftTop.css'

class RightTop extends Component {


    componentDidMount() {
        let myChart = echarts.init(document.getElementById('right-top'));

        let option = {
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'cross',
                        label: {
                            backgroundColor: '#6a7985'
                        }
                    }
                },
                legend: {
                    data: ['故障统计', '专线统计',],
                    y : '10',
                    textStyle: {
                        color: "white"
                    },
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: [
                    {
                        type: 'category',
                        boundaryGap: false,
                        axisLine: {
                            lineStyle: {
                                color: 'white'
                            }
                        },
                        data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
                    }
                ],
                yAxis: [
                    {
                        type: 'value',
                        splitLine: {
                            show: false     //去掉网格线
                        },
                        axisLine: {
                            lineStyle: {
                                color: 'white'
                            }
                        },
                    }
                ],
                series: [
                    {
                        name: '故障统计',
                        type: 'line',
                        stack: '总量',
                        areaStyle: {},
                        data: [120, 132, 101, 134, 90, 230, 210]
                    },
                    {
                        name: '专线统计',
                        type: 'line',
                        stack: '总量',
                        areaStyle: {},
                        data: [220, 182, 191, 234, 290, 330, 310]
                    },
                ]
            };


        myChart.setOption(option);

    }

    render() {
        return (

            <div className="data-box1" id="right-top"><i className="topL"/> <i className="topR"/> <i
                className="bottomL"/> <i className="bottomR"/>


            </div>
        );
    }
}

export default RightTop;
